import 'package:flutter/material.dart';

class HomeLike extends StatelessWidget {
  HomeLike({super.key, required this.goodsList});

  List goodsList = [];

  @override
  Widget build(BuildContext context) {
    return ListView.separated(
      shrinkWrap: true,
      physics: NeverScrollableScrollPhysics(),
      itemBuilder: (context, index) {
        Map item = goodsList[index];
        return Container(
          padding: EdgeInsets.all(10),
          color: Colors.white,
          child: Row(
            children: [
              Image.network(item['goods_image'], width: 80, height: 80),
              Expanded(
                child: Padding(
                  padding: EdgeInsets.only(left: 10),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    // mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Text(
                        item['goods_name'],
                        maxLines: 2,
                        overflow: TextOverflow.ellipsis,
                      ),
                      Text(
                        '已售${item['goods_sales']}件',
                        style: TextStyle(fontSize: 12, color: Colors.grey),
                      ),
                      Text(
                        '￥${item['goods_price_min']}',
                        style: TextStyle(color: Colors.red),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
        );
      },
      separatorBuilder: (context, index) {
        return Container(height: 2, color: Colors.grey[200]);
      },
      itemCount: goodsList.length,
    );
  }
}
